package cn.highedu.spring;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
//@Scope("singleton") // @Scope注解声明当前被管理对象的作用范围, Spring的默认情况就是singleton
public class SingletonBean {
    public SingletonBean() {
        System.out.println("SingletonBean对象被创建");
    }
    public void hello() {
        System.out.println("我是单例的");
    }
}
